<template>
	<view>
		<view>编号：{{goods['goodsid']}}</view>
		<view>名称：{{goods['goodsname']}}</view>
		<view>类别：{{goods['goodscategory']}}</view>
		<view>规格：{{goods['goodsstandard']}}</view>
		<view>价格：{{goods['goodsprice']}}</view>
		<view class="img-box">
			<view v-if="goods['goodspicture'].length==0">
				<image src="../../../../static/default_goods.png" class="addpic"></image>
			</view>
			<view v-else v-for="img in goods['goodspicture']">
				<image :src="img"></image>
			</view>
		</view>
		<view>库存：{{goods['goodsstock']}}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				goods: {

				},
				index: -1,
				goodsid: {
					type: Number
				}
			}
		},
		methods: {

		},
		onLoad(option) {
			console.log(option.goodsid)
			this.$myRequest({
				url: "/product/get_certain_goods/",
				data: {
					"id": option.goodsid
				}
			}).then(response => {
				this.goods = response.data;
			})
		}
	}
</script>

<style>
	.img-box {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		/* justify-content: space-around; */
		align-items: flex-start;
	}

	.addpic {
		width: 40px;
		height: 40px;
	}

	.addPics {
		width: 100%;
		display: flex;
		flex-direction: row;
		white-space: pre-wrap;
	}
</style>
